home *** CD-ROM | disk | FTP | other *** search
/ STraTOS 1997 April & May / STraTOS 1 - 1997 April & May.iso / CD01 / INTERNET / SITES / LITTLE / P3SRC.ZIP / ATARI / RADIOSIT.H < prev    next >
Encoding:
C/C++ Source or Header  |  1996-07-06  |  2.5 KB  |  78 lines

  1. /************************************************************************
  2. *  Include file for radiosit.c, Radiosity calculation routies.
  3. *
  4. *  Implemented by and (c) 1994 Jim McElhiney, mcelhiney@acm.org or 71201,1326
  5. *  All standard POV distribution rights granted.  All other rights reserved.
  6. *************************************************************************/
  7.  
  8. #ifndef RADIOSIT_H
  9. #define RADIOSIT_H
  10. #define RADIOSITY_CACHE_EXTENSION ".rca"
  11.  
  12.  
  13.  
  14. /*****************************************************************************
  15. * Global preprocessor defines
  16. ******************************************************************************/
  17.  
  18. /* #define RADDEBUG 1 */
  19.  
  20. #define MAX_NEAREST_COUNT 10
  21.  
  22.  
  23.  
  24.  
  25. /*****************************************************************************
  26. * Global typedefs
  27. ******************************************************************************/
  28.  
  29. typedef struct wt_avg_struct WT_AVG;
  30.  
  31. /* quickie structure used to gather weighted average during tree traversal */
  32. struct wt_avg_struct
  33. {
  34.   COLOUR Weights_Times_Illuminances; /* Aggregates during traversal */
  35.   DBL    Weights;   /* Aggregates during traversal */
  36.   long   Weights_Count;    /* Count of points used, aggregates during trav */
  37.   long   Good_Count;    /* Count of points used, aggregates during trav */
  38.   VECTOR P, N;     /* Point and Normal:  input to traverse */
  39.   DBL    Current_Error_Bound;   /* see Radiosity_Error_Bound */
  40.  
  41.   COLOUR Weight_Times_Illuminance[MAX_NEAREST_COUNT];
  42.   DBL    Weight[MAX_NEAREST_COUNT];
  43.   DBL    Distance[MAX_NEAREST_COUNT];
  44.   long   Close_Count;
  45. };
  46.  
  47. typedef struct byte_xyz BYTE_XYZ;
  48.  
  49. struct byte_xyz {
  50.   unsigned char x, y, z;
  51. };
  52.  
  53.  
  54. /*****************************************************************************
  55. * Global variables
  56. ******************************************************************************/
  57.  
  58. extern long ra_reuse_count;
  59. extern long ra_gather_count;
  60. extern OT_NODE *ot_root;
  61. extern FILE *ot_fd;
  62. extern COLOUR Radiosity_Gather_Total;
  63. extern long Radiosity_Gather_Total_Count;
  64. extern int Radiosity_Trace_Level;
  65. extern BYTE_XYZ rad_samples[];
  66.  
  67.  
  68. /*****************************************************************************
  69. * Global functions
  70. ******************************************************************************/
  71.  
  72. int Compute_Ambient PARAMS((VECTOR IPoint, VECTOR Normal, COLOUR Ambient_Colour, DBL Weight));
  73. long Initialize_Radiosity_Code PARAMS((void));
  74. long Deinitialize_Radiosity_Code PARAMS((void));
  75.  
  76.  
  77. #endif
  78.